import { RouterList } from "@/type";
import { lazy } from "react";

import icon1 from '@/public/image/icon1.png'
import icon2 from '@/public/image/icon2.png'
import icon3 from '@/public/image/icon3.png'
import icon4 from '@/public/image/icon4.png'
import icon5 from '@/public/image/icon5.png'

export const homeRoutes:RouterList = [
    {
        path:'/main/Recommended',
        element: lazy(()=> import('@/views/Main/Recommended')),
        title:'精品推荐',
        icon: icon1
    },
    {
        path:'/main/Workbench',
        element: lazy(()=> import('@/views/Main/Workbench')),
        title:'工作台',
        icon: icon2
    },
    {
        path:'/main/Createdesign',
        element: lazy(()=> import('@/views/Main/Createdesign')),
        title:'创建设计',
        icon: icon4
    },
    {
        path:'/main/Preferences',
        element: lazy(()=> import('@/views/Main/Preferences')),
        title:'偏好设置',
        icon: icon5
    },
    {
        path:'/main/Mycollection',
        element: lazy(()=> import('@/views/Main/Mycollection')),
        title:'我的收藏',
        icon: icon3
    }
]

const routes:RouterList =[
    {
        path: '/',
        to:'/main/Recommended'
    },
    {
        path:'/main',
        element: lazy(()=> import('@/views/Main')),
        title:'main',
        children:homeRoutes
    },
    {
        path:'/login',
        element: lazy(()=> import('@/views/Login')),
        title:'login'
    },
    {
        path:'*',
        element: lazy(()=> import('@/views/Error')),
        title:'error'
    }
]

export default routes